﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using FinancialManagement.Models.Repository;

namespace FinancialManagement.Controllers
{
    public class ReportController : Controller
    {
        private AccountRepository accountRepository = new AccountRepository();
        //
        // GET: /Report/

        public ActionResult Index()
        {
            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);
            return View();
        }
        
        /// <summary>
        /// 中南民族大学项目申报预算明细表
        /// </summary>
        /// <returns></returns>
        public ActionResult Rep_001_XMSBYSMXB()
        {
            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            var depId = accountRepository.GetDepIdByUserID(User.Identity.Name); 
            var dics = new Dictionary<string, string>();
            dics.Add("DepartmentName", depId);

            Session["reportParameters"] = dics;
            Session["reportPath"] = "/FinancialMS/Financial/Rep_001_XMSBYSMXB";
            return View();
        }
       
        /// <summary>
        /// 中南民族大学年度校级及部门专项预算申报明细表
        /// </summary>
        /// <returns></returns>
        public ActionResult Rep_003_XJZXYSMXB()
        {
            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            var depId = accountRepository.GetDepIdByUserID(User.Identity.Name);
            var dics = new Dictionary<string, string>();
            dics.Add("DepartmentID", depId);

            Session["reportParameters"] = dics;
            Session["reportPath"] = "/FinancialMS/Financial/Rep_003_XJZXYSMXB";
            return View();
        }
        
        /// <summary>
        /// 中南民族大学年度校级及部门专项预算申报汇总
        /// </summary>
        /// <returns></returns>
        public ActionResult Rep_004_XJZXYSHZB()
        {
            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            var dics = new Dictionary<string, string>();
            //dics.Add("Annual", Utils.Util.GetServerDate().Year.ToString());

            Session["reportParameters"] = dics;
            Session["reportPath"] = "/FinancialMS/Financial/Rep_004_XJZXYSHZB";
            return View();
        }
       
        /// <summary>
        /// 中南民族大学年度收入预算申报表
        /// </summary>
        /// <returns></returns>
        public ActionResult Rep_005_SRYSSBB()
        {
            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            var dics = new Dictionary<string, string>();
            //dics.Add("Annual", Utils.Util.GetServerDate().Year.ToString());

            Session["reportParameters"] = dics;
            Session["reportPath"] = "/FinancialMS/Financial/Rep_005_SRYSSBB";

            return View();
        }
      
        /// <summary>
        /// 中南民族大学年度实际收入申报表
        /// </summary>
        /// <returns></returns>
        public ActionResult Rep_006_SRSJSBB()
        {

            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            var dics = new Dictionary<string, string>();
            //dics.Add("Annual", Utils.Util.GetServerDate().Year.ToString());

            Session["reportParameters"] = dics;
            Session["reportPath"] = "/FinancialMS/Financial/Rep_006_SRSJSBB";
            return View();
        }
      
        /// <summary>
        /// 中南民族大学收入预算申报表
        /// </summary>
        /// <returns></returns>
        public ActionResult Rep_007_SRYSSBBLR()
        {
            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            var depId = accountRepository.GetDepIdByUserID(User.Identity.Name);
            var dics = new Dictionary<string, string>();
            dics.Add("DpartmentID", depId);

            Session["reportParameters"] = dics;
            Session["reportPath"] = "/FinancialMS/Financial/Rep_007_SRYSSBBLR";
            return View();
        }
      
        /// <summary>
        /// 预算申报单位负责人及编制人联系方式
        /// </summary>
        /// <returns></returns>
        public ActionResult Rep_008_YSSBDWFZRJBZRLXFS()
        {

            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            Session["reportPath"] = "/FinancialMS/Financial/Rep_008_YSSBDWFZRJBZRLXFS";
            var dics = new Dictionary<string, string>();

            Session["reportParameters"] = dics;
            return View();
        }

        /// <summary>
        /// 中南民族大学收入预算申报表（录入表）
        /// </summary>
        /// <returns></returns>
        public ActionResult Rep_009_XMSBYSMXB()
        {

            var isFinancial = accountRepository.GetRoleAdminByUserID(User.Identity.Name);
            ViewData["admin"] = isFinancial;

            ViewData["UserName"] = accountRepository.GetUserNameByUserID(User.Identity.Name);

            Session["reportPath"] = "/FinancialMS/Financial/Rep_009_XMSBYSMXB";
            var depId = accountRepository.GetDepIdByUserID(User.Identity.Name);
            var dics = new Dictionary<string, string>();
            dics.Add("DepartmentID", depId);
            Session["reportParameters"] = dics;

            return View();
        }

    }
}
